<!DOCTYPE html>
<html>
	<head>
		<title>IDE test</title>
		<script type="text/javascript" src="json2.js"></script>
		<script type="text/javascript" src="ide.js"></script>
		<script type="text/javascript">
			IDE_base = "../control.php";
			var error = function(errcode, errstr) {
				alert("Error " + errcode + ": " + errstr);
			};
			function send_auth() {
				var un = document.getElementById('username').value;
				var pw = document.getElementById('password').value;
				IDE_backend_request("auth/authenticate", {username: un, password: pw},
				                    function(response) {
				                    	alert("Authed!");
				                    }, error);
			}
			function send_deauth() {
				IDE_backend_request("auth/deauthenticate", {},
				                    function(response) {
				                    	alert("Deauthed!");
				                    }, error);
			}
		</script>
	</head>
	<body>
		<p>
			<form id="bees">
				UN: <input type="text" id="username"><br>
				PW: <input type="password" id="password"><br>
				<a href="javascript:send_auth();">auth</a>
				<a href="javascript:send_deauth();">deauth</a>
			</form>
			IDE!
		</p>
	</body>
</html>
